package com.example.springbootplm.service.impl;

import com.example.springbootplm.mapper.DeptMapper;
import com.example.springbootplm.pojo.Dept;
import com.example.springbootplm.pojo.Result;
import com.example.springbootplm.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DeptServiceImpl  implements DeptService {
    @Autowired
    private DeptMapper deptMapper;
    /*查询全部部门信息*/
    @Override
    public List<Dept> list() {
        return deptMapper.list();
    }
    /*根据id删除部门信息*/
    @Override
    public void delete(Integer id) {
        deptMapper.delete(id);
    }

    /*新增部门*/

    @Override
    public void add(Dept dept) {
        deptMapper.insert(dept);
    }

    /*第一步，根据id查找部门*/

    @Override
    public Dept getDeptById(Integer id) {
        return deptMapper.selectDeptById(id);
    }

    @Override
    public Boolean update(Dept dept) {
        return deptMapper.update(dept);
    }
}
